fi.foyt.svg.svgdom.FNISVGLineElementController = Class.create(fi.foyt.svg.svgdom.FNISVGElementController, {
  initialize: function($super){
  },
  moveTo: function(element, x, y){
    try {
    var bbox = element.getBBox();
    element.setAttributeNS(null, 'x1', x + 'px');
      element.setAttributeNS(null, 'y1', y + 'px');
    element.setAttributeNS(null, 'x2', (bbox.width + x) + 'px');
      element.setAttributeNS(null, 'y2', (bbox.height + y) + 'px');
  } catch (e) {
    throw new Error("FNISVGLineElementController::moveTo: " + e);
  }
  },
  resizeTo: function(element, width, height){
  try {  
    var bbox = element.getBBox();   
    element.setAttributeNS(null, 'x2', (bbox.x + width) + 'px');
      element.setAttributeNS(null, 'y2', (bbox.y + height) + 'px');
  } catch (e) {
    throw new Error("FNISVGLineElementController::resizeTo: " + e);
  }
  },
  moveBy: function (element, x, y) {
    try {
    var bbox = element.getBBox();
    this.moveTo(element, bbox.x + x, bbox.y + y);
  } catch (e) {
    throw new Error("FNISVGLineElementController::moveBy: " + e);
  }
  },
  resizeBy: function(element, ratioX, ratioY){
  try {  
    var bbox = element.getBBox();   
    var width = bbox.width * ratioX;
    var height = bbox.height * ratioY;
    this.resizeTo(element, width, height);        
  } catch (e) {
    throw new Error("FNISVGLineElementController::resizeBy: " + e);
  }
  },
  setLine: function (element, x1, y1, x2, y2) {
    if (x1)
    element.setAttributeNS(null, 'x1', x1 + 'px');
  if (y1)
      element.setAttributeNS(null, 'y1', y1 + 'px');
  if (x2)
    element.setAttributeNS(null, 'x2', x2 + 'px');
  if (y2)
      element.setAttributeNS(null, 'y2', y2 + 'px');
  },
  supports: function (operation) {
    return ((operation == fi.foyt.svg.svgdom.FNISVGElementController.OPERATION_MOVE)||(operation == fi.foyt.svg.svgdom.FNISVGElementController.OPERATION_RESIZE));
  }
});